/*
 * @Author: 张久冬
 * @Date: 2021-12-20 22:37:07
 * @
# Description:
 */
import type { AxiosRequestConfig, AxiosResponse } from 'axios'

export interface jdrequestInterceptor<R = AxiosResponse> {
  // 请求拦截
  requestInterceptor?: (config: AxiosRequestConfig) => AxiosRequestConfig
  requestInterceptorCatch?: (err: any) => any
  // 响应拦截
  // responseInterceptor?: (config: AxiosResponse) => AxiosResponse
  responseInterceptor?: (config: R) => R
  responseInterceptorCatch?: (err: any) => any
}
// 对axios内部接口进行拓展
export interface jdrequestConfig<R = AxiosResponse> extends AxiosRequestConfig {
  interceptor?: jdrequestInterceptor<R>
  showLoading?: boolean
}
